package com.campus.food.model.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商家实体类
 * 对应数据库表：t_merchant
 * 
 * @author Claude3.7 Sonnet
 * @since 2025-05-29
 */
@Data
//@EqualsAndHashCode(callSuper = false)
public class Merchant {
    
    /**
     * 商家ID
     */
    private Long id;
    
    /**
     * 关联的用户ID
     */
    private Long userId;
    
    /**
     * 店铺名称
     */
    private String shopName;
    
    /**
     * 店铺LOGO
     */
    private String shopLogo;
    
    /**
     * 店铺描述
     */
    private String shopDesc;
    
    /**
     * 营业时间
     */
    private String businessHours;
    
    /**
     * 联系人
     */
    private String contactPerson;
    
    /**
     * 联系电话
     */
    private String contactPhone;
    
    /**
     * 店铺地址
     */
    private String shopAddress;
    
    /**
     * 营业执照图片URL
     */
    private String businessLicense;
    
    /**
     * 食品经营许可证图片URL
     */
    private String foodLicense;
    
    /**
     * 审核状态：0-待审核，1-审核通过，2-审核拒绝
     */
    private Integer status;
    
    /**
     * 营业状态：0-休息中，1-营业中
     */
    private Integer businessStatus;
    
    /**
     * 店铺评分
     */
    private BigDecimal rating;
    
    /**
     * 月销量
     */
    private Integer monthlySales;
    
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    
    /**
     * 审核状态枚举
     */
    public enum Status {
        PENDING(0, "待审核"),
        APPROVED(1, "审核通过"),
        REJECTED(2, "审核拒绝");
        
        private final Integer code;
        private final String desc;
        
        Status(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }
        
        public Integer getCode() {
            return code;
        }
        
        public String getDesc() {
            return desc;
        }
    }
    
    /**
     * 营业状态枚举
     */
    public enum BusinessStatus {
        CLOSED(0, "休息中"),
        OPEN(1, "营业中");
        
        private final Integer code;
        private final String desc;
        
        BusinessStatus(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }
        
        public Integer getCode() {
            return code;
        }
        
        public String getDesc() {
            return desc;
        }
    }
} 